From be0964d9e1d110ff647d3d6433835786b88f9435 Mon Sep 17 00:00:00 2001
From: Lauri Vuorela <lauri.vuorela@gmail.com>
Date: Mon, 5 Feb 2024 02:16:30 +0100
Subject: format currency with thousand separators (#81)

---
 src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx')

diff --git a/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx b/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
index b6df672..c157cc9 100644
--- a/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
+++ b/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
@@ -26,7 +26,7 @@ import {
 import { ToastAction } from '@/components/ui/toast'
 import { useToast } from '@/components/ui/use-toast'
 import { useMediaQuery } from '@/lib/hooks'
-import { formatExpenseDate } from '@/lib/utils'
+import { formatCurrency, formatExpenseDate } from '@/lib/utils'
 import { Category } from '@prisma/client'
 import { ChevronRight, FileQuestion, Loader2, Receipt } from 'lucide-react'
 import { getImageData, usePresignedUpload } from 'next-s3-upload'
@@ -185,9 +185,7 @@ export function CreateFromReceiptButton({
               <div>
                 {receiptInfo ? (
                   receiptInfo.amount ? (
-                    <>
-                      {groupCurrency} {receiptInfo.amount.toFixed(2)}
-                    </>
+                    <>{formatCurrency(groupCurrency, receiptInfo.amount)}</>
                   ) : (
                     <Unknown />
                   )
-- 
cgit v1.3

